package com.mooneros.study.designpattern.strategy;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 初始化
 * @author mac
 */
@Service
public class TestStrategySimpleService implements InitializingBean {

    @Autowired
    private List<IStudyService> studyServiceList;


    private Map<StudyLanagueEnum,IStudyService> studyServiceMap;


    @Override
    public void afterPropertiesSet()   {
        if(CollectionUtils.isEmpty(studyServiceList)) {
            this.studyServiceMap = new HashMap<>();
         }
//        this.studyServiceMap = studyServiceList.stream().collect(Collectors.toMap(IStudyService::studyLanague))
    }
}
